export function GetCurrentAddress() {
	return new Promise((resolve, reject) => {
		uni.authorize({
			scope: 'scope.userLocation',
			success: () => {
				uni.getLocation({
					type: 'gcj02',
					success: res => {
						resolve(res);
					},
					fail: err => {
						console.error(err)
						reject(err);
					}
				});
			},
			fail: (err) => {
				uni.showModal({
					title: '提示',
					content: '获取定位失败，请修改授权信息！',
					confirmText: "去修改",
					success: function(res) {
						if (res.confirm) {
							uni.getSetting({
								success(res) {
									if (res.authSetting &&
										!res.authSetting['scope.userLocation']
									) {
										uni.openSetting({
											success(res) {
												console.log(res)
											}
										});
									}
								}
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				reject(err);
			},
			complete: () => {}
		});
	})
}